@extends('admin.main')
@section('body')
    <div class="main-title">
        <h2>账号移交 ({{$shop['shop_name']}})</h2>
    </div>
    <div class="tab-wrap">
        <div class="tab-content">
            <form action="" method="post" class="form-horizontal">
                <div class="form-item">
                    <label class="item-label">
                        <h2 style="color: orange">确认移交人信息</h2>
                    </label>
                </div>
                {{--<span style="color: blue;background-color: white;line-height: 40px;height: 150px;font-size: 20px;">↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓</span>--}}
                <div class="form-item">
                    <label class="item-label">
                        客户ID：<span class="check-tips">{{$member['id']}}</span>
                    </label>
                </div>
                <div class="form-item">
                    <label class="item-label">
                        客户名称：<span class="check-tips">{{$member['name']}}</span>
                    </label>
                </div>
                <div class="form-item">
                    <label class="item-label">
                        联系方式：<span class="check-tips">{{$member['mobile']}}</span>
                    </label>
                </div>
                <div class="form-item">
                    <label class="item-label">
                        详细地址：<span class="check-tips">{{$member['area_info'].' '.$member['address']}}</span>
                    </label>
                </div>
                <div class="form-item">
                    <label class="item-label">
                        单位名称：<span class="check-tips">{{$member['company_name']}}</span>
                    </label>
                </div>
                <br>
                <div class="form-item">
                    <label class="item-label">
                        <hr>
                    </label>
                </div>
                <div class="form-item">
                    <label class="item-label">
                        受移交人ID<span class="check-tips">（提示：【受移交人ID】 请在受移交人的个人中心查看）</span>
                    </label>
                    <div class="controls">
                        <input type="text" name="move_id" id="move_id" class="text input-large" value="">
                    </div>
                </div>
                <div class="form-item">
                    <label class="item-label"></label>
                    <div class="controls">
                        <input type="hidden" name="mid" value="{{$member['id']}}">
                        <input type="hidden" name="shop_id" value="{{$member['shop_id']}}">
                        <input type="hidden" name="admin_id" value="{{$member['admin_id']}}">
                        <a class="btn submit-btn" target-form="form-horizontal" onclick="tijiao()">确 定</a>
                        <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
@endsection

@section('script')
    <script>
        function tijiao() {
            var move_id = $("#move_id").val();
            if (move_id == '' || move_id == null || move_id == undefined) {
                layer.msg('请填写受移交人ID');
                return;
            }
            if (isNaN(move_id)) {
                layer.msg('受移交人ID必须为数字');
                return;
            }
            if (!parseInt(move_id)) {
                layer.msg('请填写受移交人ID');
                return;
            }
            layer.confirm('将当前用户信息移交给ID为 ' + move_id + ' 的用户？', {title: '确认转移移交信息'}, function (index) {
                layer.close(index);
                $.post('{{url()->current()}}', $(".form-horizontal").serialize(), function (res) {
                    layer.msg(res.info);
                    if (res.status == 1) {
                        setTimeout(function () {
                            window.location.href = res.url;
                        }, 3000);
                    }
                })
            });
        }

    </script>
@endsection
